#include "extensiondeclarationlist.h"

namespace yc {

ExtensionDeclarationList::ExtensionDeclarationList() { }

bool ExtensionDeclarationList::contains(const QString& type) const
{
    bool found = false;
    for (const auto& d : declarations_) {
        if (d.type().compare(type, Qt::CaseInsensitive) == 0) {
            found = true;
            break;
        }
    }
    return found;
}

ExtensionDeclaration ExtensionDeclarationList::find(const QString& type) const
{
    for (const auto& d : declarations_) {
        if (d.type().compare(type, Qt::CaseInsensitive) == 0) {
            return d;
        }
    }
    return ExtensionDeclaration();
}
} // namespace yc
